<?php

/**
 * MyAccount
 */
/**
 * Namespace
 */
namespace plurious\apps\admin\controller;
/**
 * Dependencies
 */
use framework\engine\Controller;
use plurious\apps\admin\model\User_admin_model;

/**
 * Allows users to change account information and password
 * 
 * This form does not allow the user to change their organization.  This was
 * built for an organizational based access system.
 * 
 * @author Randy Casburn <randy@plurious.com>
 * @copyright Copyright Plurious Software, all rights reserved
 * @license MIT
 * @license http://www.opensource.org/licenses/mit-license.html
 * @link http://plurious.com/framework/documentation/classes/Front.html
 * @version x.X
 * @filesource
 * 
 * @uses ...
 */
class Myaccount extends Controller {
    /**
     * Allows caching of the page
     * 
     * Do not cache dynamic content or any controller that includes the 
     * login module.
     * @var bool $isCachable
     */
    protected $isCachable = false;

    /**
     * Short Description 
     * @var <type> name
     */
    private $userData;

    /**
     * Index used to...
     */
    public function index() {
        if (!$this->user->hasContext('admin')) {
            $this->document->redirect('error/auth_failure');
        }
        $model = new User_admin_model;
        $user_id = $this->user->getId();
        $userData = $model->getUser($this->user->getId());
        $this->data['user'] = $userData;
    }

}

?>
